function(new_doc, old_doc, userCtx) {
  if(!userCtx.name) {
    // CouchDB sets userCtx.name only after a successful authentication
    throw({forbidden: "Please log in first."});
  }
  if ( userCtx.roles.indexOf('_admin') == -1 &&
		  userCtx.roles.indexOf('butterfly') == -1 ) {
	  throw({forbidden: "You are not in a role which allows updating the butterfly db."});
  }
}
